#pragma once
#include <string>
#include <iostream>

enum PokemonType
{
	NORMAL, FIGHTING, FLYING, POISON, GROUND, ROCK, BUG, GHOST, FIRE, WATER, GRASS, ELECTRIC, PSYCHIC, ICE, DRAGON, TYPE_NONE
};

enum StatusEffect
{
	STATUS_NONE, BURN, FREEZE, PARALYZE, POISONED, SLEEP, FAINT, HEAL, DRAIN, CONFUSE, FLINCH, FIX_DAMAGE, RECOIL, STAND_BY, COOLDOWN, ACY_BOOST, ACY_NERF, ATK_BOOST, ATK_NERF, DEF_BOOST, DEF_NERF, SPD_BOOST, SPD_NERF, SP_BOOST, SP_NERF
};

enum AnimationName
{
	ANIMATION_NONE, SCYTHE, METEOR, EXPLOSION1, EXPLOSION2, VINE_WHIP, EYE, OVER_HERE, ROOT, BUBBLE, WATER_DROP, WATER_PILLAR, SHIELD, BONE, FIRE_SLASH, SMOKE, SMOKE_GREEN, SMOKE_PURPLE, GUILLOTINE, THUNDER_STRIKE, TORNADO
};

enum GroupDifficulty
{
	EASY, MEDIUM, HARD
};

enum PokemonTag
{
	PLAYER, ENEMY
};

enum GamePhase
{
	COMBAT_INITIATION, SELECT_ACTION, SELECT_ATTACK, PLAYER_STANDBY, PLAYER_ATTACK, ENEMY_STANDBY, ENEMY_ATTACK, SWAP_POKEMON, CATCH_POKEMON, RUN, PLAYER_ATTACK_RECAP, ENEMY_ATTACK_RECAP, 
	FIGHT_SUMMARY, FORGET_ATTACK, END_TURN
};


static const int PLAYER_LIFEBAR_POSITION_X = 184;
static const int PLAYER_LIFEBAR_POSITION_Y = 92;
static const int ENEMY_LIFEBAR_POSITION_X = 44;
static const int ENEMY_LIFEBAR_POSITION_Y = 21;
static const int XPBAR_POSITION_X = 168;
static const int XPBAR_POSITION_Y = 108;

static const int MAIN_TEXT_POSITION_X = 8;
static const int MAIN_TEXT_POSITION_Y = 119;

static const int ATTACK_MENU_POSITION_X = 0;
static const int ATTACK_MENU_POSITION_Y = 112;
static const int ATTACK_TEXT_POSITION_X = 13;
static const int ATTACK_TEXT_POSITION_Y = 118;

static const int ACTION_MENU_POSITION_X = 120;
static const int ACTION_MENU_POSITION_Y = 112;
static const int ACTION_1_CURSOR_POSITION_X = 125;
static const int ACTION_1_CURSOR_POSITION_Y = 112;
static const int ACTION_2_CURSOR_POSITION_X = 185;
static const int ACTION_2_CURSOR_POSITION_Y = 112;
static const int ACTION_3_CURSOR_POSITION_X = 185;
static const int ACTION_3_CURSOR_POSITION_Y = 132;
static const int ACTION_4_CURSOR_POSITION_X = 125;
static const int ACTION_4_CURSOR_POSITION_Y = 132;

static const int ATTACK_INFO_MENU_X = 160;
static const int ATTACK_INFO_MENU_Y = 112;

static const int ENEMY_POSITION_X = 150;
static const int ENEMY_POSITION_Y = -35;
static const int PLAYER_POSITION_X = 5;
static const int PLAYER_POSITION_Y = 12;

static const int ENEMY_ATTACK_POSITION_X = 150;
static const int ENEMY_ATTACK_POSITION_Y = 35;
static const int PLAYER_ATTACK_POSITION_X = 20;
static const int PLAYER_ATTACK_POSITION_Y = 75;

static const int POKEMON_WIDTH = 100;
static const int POKEMON_HEIGHT = 100;

static const int MAX_POKEMON_LEVEL = 100;
static const int MIN_POKEMON_LEVEL = 1;
static const int MAX_POKEMON_ATTACK = 4;
static const int MAX_POKEMON_TYPE = 2;
static const int MAX_POKEMON_IN_PARTY = 6;
static const int MAX_EV = 65535;
static const float MAX_XP = 1000000;

static const int STARTER_LEVEL = 5;
static const int NO_TURN_LIMIT = -1;
static const int BASE_XP_GIVEAWAY = 100;

static const int EASY_GROUP_COUNT = 50;
static const int MEDIUM_GROUP_LEVEL = 25;
static const int MEDIUM_GROUP_COUNT = 57;
static const int HARD_GROUP_LEVEL = 40;
static const int HARD_GROUP_COUNT = 43;

static const int TYPE_COUNT = 15;
static const int POKEMON_COUNT = 151;
static const int ATTACK_COUNT = 159;
static const int STATUS_COUNT = 25;
static const int CRIT_CHANCE = 5;
static const int STAT_COUNT = 6;
static const int GROUP_COUNT = 3;
static const int ANIM_COUNT = 20;

static const int HP_INDEX = 0;
static const int ATK_INDEX = 1;
static const int DEF_INDEX = 2;
static const int SPATK_INDEX = 3;
static const int SPDEF_INDEX = 4;
static const int SPD_INDEX = 5;

static const int PARALYZE_ACCURACY = 25;
static const int CONFUSION_ACCURACY = 50;
static const int THAW_ACCURACY = 25;

static const float EPSILON = 0.01f;

struct PokemonData
{
	int number;
	std::string name;
	int hp;
	int attack;
	int defense;
	int spAttack;
	int spDefense;
	int speed;
	bool canEvolve;
	int evolveLevel;
	PokemonType type1;
	PokemonType type2;
	int xpGiveaway;
};

struct AttackData
{
	int number;
	std::string name;
	PokemonType type;
	int pp;
	int power;
	int accuracy;
	bool targetOther;
	StatusEffect status;
	int statusValue;
	AnimationName animation;
};

struct LevelUpData
{
	int level;
	std::string attack;
};

struct StatusAilmentData
{
	StatusEffect status;
	int maxTurnAffected;
	int turnAffected;
};

struct AnimationData
{
	int nbFrames;
	int frameX;
	int frameY;
	int width;
	int height;
	bool isHorizontal;
};